home *** CD-ROM | disk | FTP | other *** search
- Path: siemens.at!betik
- From: betik@siemens.co.at (Vlade (SWH) / Betik (SWH))
- Newsgroups: comp.lang.c
- Subject: C-Algorithm question
- Date: 26 Feb 1996 16:50:56 GMT
- Organization: Siemens AG Austria
- Message-ID: <4gsodg$jqm@news.siemens.at>
- NNTP-Posting-Host: mx5217.gud.siemens-austria
- X-Newsreader: TIN [version 1.2 PL2]
-
- Hello friends,
-
- I'd like to know if exists a standard algorithm, that transforms this table:
-
-
- idx | CA | CS | NB |
- ----+----+----+-----
- 0 | SU | NO | SG |
- 1 | SU | NO | SG |
- 2 | SU | GE | PL |
- 3 | AD | GE | SG |
- 4 | AD | GE | PL |
- 5 | PR | IN | SG |
-
- into this tree:
-
- o NB
- / \
- -SG---- ----PL-
- / \
- o CA o CS
- / | \ |
- --SU- AD --PR- GE
- / | \ |
- o CS o CS o CS o CAT
- | | | / \
- NO GE IN SU AD
- | | | | |
- o idx o idx o idx o idx o idx
- / \ | | | |
- 0 1 3 5 2 4
-
- where NB is the root of the tree because it contains the smallest set of its
- values [SG,PL], and SG is the first edge of the node NB, because it occurs
- the most frequently in the set of the node NB.
-
- Thanks for any help.
-
- Vlado Betik
- betik@swh.sk
-